<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			#timeDiv
			{
					background-color: #000000;
					color: white;
					font-size: 80px;
			}
			
		</style>
	</head>
	<body>
		
		<div id="timeDiv">13:55:00</div>
		
		<script type="text/javascript">
// 0611练习1:
// 写一个数字时钟，每秒刷新一下 使用定时器和日期时间对象
			
			function refreshTime()
			{
				var now = new Date();// 得到当前时间
				var h = ""+now.getHours();
				if(h.length<2) h = "0"+h;
				var m = ""+now.getMinutes();
				if(m.length<2) m = "0"+m;
				var s = ""+now.getSeconds();
				if(s.length<2) s = "0"+s;
				timeDiv.textContent = h + ":" + m + ":"+s;
			}
			refreshTime();
// * 练习2
// 设定一个倒数时间(比如距离奥运会开幕)
			
		</script>
	</body>
</html>
